<admintpl file="header" />
</head>
<body class="J_scroll_fixed">
	<div class="wrap J_check_wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('slide/index')}">所有幻灯片</a></li>
			<li><a href="{:U('slide/add')}">添加幻灯片</a></li>
		</ul>
		<form class="well form-search" method="post" id="cid_form">
			<div class="search_type cc mb10">
				<div class="mb10">
					<select class="select_2" name="cid" style="width: 100px;" id="selected_cid">
						<option value=''>全部</option>
						<foreach name="categorys" item="vo">
						<php>$cid_select=$vo['cid']===$slide_cid?"selected":"";</php>
						<option value="{$vo.cid}"{$cid_select}>{$vo.cat_name}</option>
						</foreach>
					</select>
				</div>
			</div>
		</form>
		<form class="J_ajaxForm" action="" method="post">
			<div class="table-actions">
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:u('slide/listorders')}">排序</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:u('slide/toggle',array('display'=>1))}" data-subcheck="true">显示</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:u('slide/toggle',array('hide'=>1))}" data-subcheck="true">隐藏</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('slide/delete')}" data-subcheck="true">删除</button>
			</div>
			<php> $status=array("1"=>"显示","0"=>"隐藏"); </php>
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="15"><label><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x"></label></th>
						<th width="50">排序</th>
						<th width="50">ID</th>
						<th width="200">标题</th>
						<th width="200">描述</th>
						<th width="100">链接</th>
						<th width="50">图片</th>
						<th width="50">状态</th>
						<th width="80">操作</th>
					</tr>
				</thead>
				<foreach name="slides" item="vo">
				<tr>
					<td><input type="checkbox" class="J_check" data-yid="J_check_y" data-xid="J_check_x" name="ids[]" value="{$vo.slide_id}"></td>
					<td><input name='listorders[{$vo.slide_id}]' class="input input-order mr5" type='text' size='3' value='{$vo.listorder}'></td>
					<td>{$vo.slide_id}</td>
					<td>{$vo.slide_name}</td>
					<td>{$slide_des = mb_substr($vo['slide_des'], 0, 48,'utf-8')}</td>
					<td>{$vo.slide_url}</td>
					<td>
						<if condition="!empty($vo['slide_pic'])">
							<a href="{:sp_get_asset_upload_path($vo['slide_pic'])}" target="_blank">查看</a>
						</if>
					</td>
					<td>{$status[$vo['slide_status']]}</td>
					<td>
						<a href="{:U('slide/edit',array('id'=>$vo['slide_id']))}">修改</a>
						<a href="{:U('slide/delete',array('id'=>$vo['slide_id']))}" class="J_ajax_del">删除</a>
						<if condition="empty($vo['slide_status']) eq 1">
							<a href="{:U('slide/cancelban',array('id'=>$vo['slide_id']))}" class="J_ajax_dialog_btn" data-msg="确定显示此幻灯片吗？">显示</a>
						<else /> 
							<a href="{:U('slide/ban',array('id'=>$vo['slide_id']))}" class="J_ajax_dialog_btn" data-msg="确定隐藏此幻灯片吗？">隐藏</a>
						</if>
					</td>
				</tr>
				</foreach>
				<tfoot>
					<tr>
						<th width="15"><label><input type="checkbox" class="J_check_all" data-direction="x" data-checklist="J_check_x"></label></th>
						<th width="50">排序</th>
						<th width="50">ID</th>
						<th width="200">标题</th>
						<th width="200">描述</th>
						<th width="100">链接</th>
						<th width="50">图片</th>
						<th width="50">状态</th>
						<th width="80">操作</th>
					</tr>
				</tfoot>
			</table>
			<div class="table-actions">
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:u('slide/listorders')}">排序</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:u('slide/toggle',array('display'=>1))}" data-subcheck="true">显示</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:u('slide/toggle',array('hide'=>1))}" data-subcheck="true">隐藏</button>
				<button class="btn btn-primary btn-small J_ajax_submit_btn" type="submit" data-action="{:U('slide/delete')}" data-subcheck="true">删除</button>
			</div>
		</form>
	</div>
	<script src="__ROOT__/statics/js/common.js?"></script>
	<script>
		setCookie('refersh_time', 0);
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location.reload();
			}
		}
		setInterval(function() {
			refersh_window()
		}, 3000);
		$(function() {
			$("#selected_cid").change(function() {
				$("#cid_form").submit();
			});
		});
	</script>
</body>
</html>